package com.g2.admin.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.g2.admin.dao.mapper.IAuthSystemMapper;
import com.g2.admin.model.po.AuthSystemPo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class AuthSystemService {
    @Autowired
    private IAuthSystemMapper authsystemMapper;

    public List<AuthSystemPo> getAuthsystems() {
        return authsystemMapper.selectList(new QueryWrapper<>());
    }

    public AuthSystemPo getAuthsystem(String code) {
        return authsystemMapper.selectById(code);
    }

    public void delAuthsystem(String code) {
        authsystemMapper.deleteById(code);
    }

    public void addAuthsystem(AuthSystemPo authsystem) {
        authsystemMapper.insert(authsystem);
    }

    public void updateAuthsystem(AuthSystemPo authsystem) {
        authsystemMapper.updateById(authsystem);
    }
}
